<?php
function __autoload($class){
	require_once '../'.$class.'.php';
}
$formType = "delete";
require_once 'adminHeader.php';
?>
	<script type="text/javascript">
		function confirmDeletePlayer() {
			$confirm = confirm("Are you sure want to delete " + document.getElementById("player").value+"?");
			return $confirm;
		}
	</script>
	<form action='<?php echo $_SERVER['PHP_SELF']; ?>' method='post'>
		<p>
			Select from which team would you like to delete player? <select
				name='allteams' id='allteams'>
				<?php $dbconnect = new DBconnect();
				$dbconnect->displayAllRealTeams();
				?>
		</p>
		<p>
			<input type='submit' name='selectteam' value='Select'>
	
	</form>
	<?php
	if(isset($_POST['selectteam'])){
		$dbconnect->displayAllRealPlayers($_POST['allteams'], $formType);
	}

	if(isset($_POST[$formType])){
		$dbconnect->deleteRealPlayer($_POST['player']);
	}
	require_once 'adminFooter.php';
	?>